package com.tencreat.domain.mall;

import com.baomidou.mybatisplus.annotation.*;
import com.tencreat.common.annotation.Excel;
import com.tencreat.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;


/**
 * 消息记录对象 mall_message_record
 *
 * @author tencreat
 * @date 2021-11-24
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
@TableName("mall_message_record")
public class MallMessageRecord extends BaseEntity<MallMessageRecord>{
    private static final long serialVersionUID = 1L;


    /** 编号 */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "ID")
    private Long id;

    @ApiModelProperty("消息ID")
    private String msgId;

    /** 用户ID;消息发送者app端存uuid,平台端存id */
    @Excel(name = "用户ID;消息发送者app端存uuid,平台端存id")
    @ApiModelProperty(value= "用户ID;消息发送者app端存uuid,平台端存id")
    @TableField("`user_id`")
    private Long userId;


    /** 关联用户ID;消息接收者app端存uuid,平台端存id */
    @Excel(name = "关联用户ID;消息接收者app端存uuid,平台端存id")
    @ApiModelProperty(value= "关联用户ID;消息接收者app端存uuid,平台端存id")
    @TableField("`join_user_id`")
    private Long joinUserId;


    /** 消息内容 */
    @Excel(name = "消息内容")
    @ApiModelProperty(value= "消息内容")
    @TableField("`msg`")
    private String msg;

    /** 消息类型 0|普通,1|图片,2|语音,3|视频*/
    @ApiModelProperty(value= "消息类型 0|普通,1|图片,2|语音,3|视频,4|商品ID")
    private Integer msgType;

    @ApiModelProperty(value= "读取状态 0-未读 1-已读")
    @TableField("`unread_status`")
    private Integer unreadStatus;

    /** 删除标志;0代表存在 2代表删除 */
    @TableLogic
    @TableField("`del_flag`")
    private String delFlag;


    /** 乐观锁 */
    @Excel(name = "乐观锁")
    @ApiModelProperty(value= "乐观锁")
    @TableField("`revision`")
    private Long revision;


    /** 租户号 */
    @Excel(name = "租户号")
    @ApiModelProperty(value= "租户号")
    @TableField("`tenant_id`")
    private Long tenantId;
    /****
     * 语音时长
     */
    @Excel(name = "语音时长")
    @ApiModelProperty(value= "语音时长")
    @TableField("`duration`")
    private int duration;

    /** 发送者名称 */
    @ApiModelProperty(value= "名称")
    @TableField(exist = false)
    private String nickName;

    /** 发送者头像 */
    @ApiModelProperty(value= "头像")
    @TableField(exist = false)
    private String photo;
    @ApiModelProperty(value= "商品名称")
    @TableField(exist = false)
    private String goodsName;
    @ApiModelProperty(value= "商品图片")
    @TableField(exist = false)
    private String picUrl;
    @ApiModelProperty(value= "商品价格")
    @TableField(exist = false)
    private BigDecimal retailPrice;
    @ApiModelProperty(value= "商品销量")
    @TableField(exist = false)
    private Integer sales;
}
